extends teacher

block sub-container
  link(rel='stylesheet', href='/stylesheets/bootstrap-datetimepicker.min.css')

  h1.page-header 编辑作业

  form.form-horizontal(method='post')
    .form-group
      label.col-sm-2.control-label 作业标题
      .col-sm-10.col-md-5
        input.form-control(type='text' name='title' value='#{homework.title}' disabled)

    .form-group
      label.col-sm-2.control-label 截止时间
      .col-sm-10.col-md-5
        .input-group.date.form_datetime(data-date-format='yyyy-mm-dd hh:ii')
          input.form-control(size='16', type='text', value='#{homework.deadline}', readonly='' name='deadline')
          span.input-group-addon
            span.glyphicon.glyphicon-remove
          span.input-group-addon
            span.glyphicon.glyphicon-th

    .form-group
      label.col-sm-2.control-label 具体要求
      .col-sm-10
        textarea.form-control(rows='15' name='requirement') #{homework.requirement}

    .form-group
      .col-sm-offset-2.col-sm-10
        button.btn.btn-default(type='submit') 保存
        a.btn.btn-default(href='/home') 取消

  script(type='text/javascript', src='/javascripts/bootstrap-datetimepicker.min.js')
  script(type='text/javascript', src='/javascripts/bootstrap-datetimepicker.zh-CN.js')
  script(type='text/javascript').
    $('.form_datetime').datetimepicker({
      language:  'zh-CN',
      weekStart: 1,
      todayBtn:  1,
      autoclose: 1,
      todayHighlight: 1,
      startView: 2,
      forceParse: 0
    });
